#include "TTToeState.h"
#include "TTToePosition.h"

#include <cstdio>

namespace SmartTTToe {
	TTToeState::TTToeState(TTToePosition* p, int val) {
		this->position = new TTToePosition();
		this->position->SetX(p->GetX());
		this->position->SetY(p->GetY());
		this->value = val;
	}

	TTToeState::TTToeState() {
		this->position = new TTToePosition();
		this->value = 0;
	}

	TTToeState::~TTToeState(void) {
		if (this->position) {
			delete this->position;
			this->position = NULL;
		}
	}

	void TTToeState::SetState(TTToePosition* p, int val) {
		this->position->SetX(p->GetX());
		this->position->SetY(p->GetY());
		this->value = val;
	}

	TTToePosition* TTToeState::GetPosition() {
		return this->position;
	}

	int TTToeState::GetValue() {
		return this->value;
	}
}